package com.wang.service.impl;

import com.wang.bean.Singlechoice;
import com.wang.bean.TestPaper;
import com.wang.mapper.SinglechoiceMapper;
import com.wang.mapper.TestMapper;
import com.wang.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TestServiceImpl implements TestService {

    @Autowired
    private TestMapper testMapper;

    @Autowired
    private SinglechoiceMapper singlechoiceMapper;

    @Override
    public List<TestPaper> randbynumber(Integer num) {
        return singlechoiceMapper.randbynumber(num);
    }

    @Override
    public TestPaper selectoneTestPaper(Long id) {
        return singlechoiceMapper.selectoneTestPaper(id);
    }

    @Override
    public void addTestPaper(TestPaper testPaper) {
        testMapper.addTestPaper(testPaper);
    }

    @Override
    public List<TestPaper> findTestPaperByExaminationId(String examination_id) {
        return testMapper.findTestPaperByExaminationId(examination_id);
    }

    @Override
    public TestPaper findOneTestPaperByExaminationIdSinglechoiceId(TestPaper testPaper) {
        return testMapper.findOneTestPaperByExaminationIdSinglechoiceId(testPaper);
    }
}
